Micron Document
🎖️GitЯра🎖️

Node / meshtastic / Meshtastic-Android / files / core / repository / src / commonMain / kotlin / org / meshtastic / core / repository / DeviceHardwareRepository.kt

Displaying Raw • Download

core/repository/src/commonMain/kotlin/org/meshtastic/core/repository/DeviceHardwareRepository.kt 4f86b91973784e4ec05b9a5c7b2dc396ed4848b8 (4f86b919) Text, 2.06 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.repository

Tff7b72import T7ee787kotlinx.coroutines.flow.Flow
Tff7b72import T7ee787org.meshtastic.core.model.DeviceHardware

Tff7b72interface T56d364DeviceHardwareRepository Tb4b4b4{
T8b949e/**
* Retrieves device hardware information by its model ID and optional target string.
*
* @param hwModel The hardware model identifier.
* @param target Optional PlatformIO target environment name to disambiguate multiple variants.
* @param forceRefresh If true, the local cache will be invalidated and data will be fetched remotely.
* @return A [Result] containing the [DeviceHardware] on success (or null if not found), or an exception on failure.
*/
Tff7b72suspend Tff7b72fun Td2a8ffgetDeviceHardwareByModelTb4b4b4(
Te6edf3hwModelTb4b4b4: Tffa657IntTb4b4b4,
Te6edf3targetTb4b4b4: Tffa657String? Tff7b72= Tff7b72nullTb4b4b4,
Te6edf3forceRefreshTb4b4b4: Tffa657Boolean Tff7b72= Tff7b72falseTb4b4b4,
Tb4b4b4)Tb4b4b4: Te6edf3ResultTff7b72<Te6edf3DeviceHardware?Tff7b72>

T8b949e/**
* Observes device hardware information as a non-blocking [Flow].
*
* Emits cached/bundled data immediately and refreshes from the network in the background if stale. Suitable for use
* inside Flow `combine` transforms where suspending would block the UI.
*
* @param hwModel The hardware model identifier.
* @param target Optional PlatformIO target environment name to disambiguate multiple variants.
*/
Tff7b72fun Td2a8ffobserveDeviceHardwareTb4b4b4(Te6edf3hwModelTb4b4b4: Tffa657IntTb4b4b4, Te6edf3targetTb4b4b4: Tffa657String? Tff7b72= Tff7b72nullTb4b4b4)Tb4b4b4: Te6edf3FlowTff7b72<Te6edf3DeviceHardware?Tff7b72>
Tb4b4b4}

Served by rngit 1.5.0 - Generated in 0.04s